package com.demo.bookstore.mapper;

import com.demo.bookstore.model.BookEntity;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface BookEntityManualMapper extends BookEntityMapper {
    @Select("select * from tb_book limit #{pageSize} offset #{pageBegin}")
    List<BookEntity> selectByPage(@Param("pageBegin") int pageBegin, @Param("pageSize") int  pageSize);

    int batchInsert(@Param("bookEntityList") List<BookEntity> bookEntityList);

    @Select("select count(*) from tb_book")
    int totalCount();

    @Select("select * from tb_book where name = #{name}")
    List<BookEntity> queryByName(@Param("name") String name);
}
